package cn.tedu.baidashi.mapper;

import cn.tedu.baidashi.model.Address;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author tedu.cn
 * @since 2022-02-16
 */
@Repository
public interface AddressMapper extends BaseMapper<Address> {
    @Select("SELECT * FROM address  LEFT JOIN customer   ON  address.customer_name=customer.customer_name WHERE  customer.customer_name=#{customerName}")
    List<Address> findAddressByCustomerName(String customerName);

    @Select("SELECT * FROM address WHERE address.customer_name=#{customerName};")
    Address findAddressIdByCustomerName(String customerName);
}
